/*
 * Layer.cpp
 *
 *  Created on: 28 nov. 2012
 *      Author: johan
 */

#include "Layer.h"
#include "Renderable.h"

namespace ge {

	Layer::Layer()
	{
		visible=true;
	}

	void Layer::render(){
		if(!visible)
			return;

		for (Renderable * r : elts)
			r->render();
	}

	bool Layer::addRenderable(Renderable * elt) {
		elts.push_back(elt);
		return true;
	}

	// return <element deleted>
	bool Layer::delRenderable(Renderable * elt) {
		std::size_t s =  elts.size();
		elts.remove(elt);
		return s != elts.size();
	}

	void Layer::setVisible(bool visibility){
		visible = visibility;
	}

	bool Layer::getVisible() const{
		return visible;
	}

	Layer::~Layer()
	{
		// TODO Auto-generated destructor stub
	}

} /* namespace ge */
